import request from "@/utils/request"
const BASE_URL = process.env.VUE_APP_BASE_URL_BI

/**
 * 城市分布分析
 */
export function biAchievementAnalysisAPI(data) {
	return request({
		url: BASE_URL + "biRanking/addressAnalyse",
		method: "post",
		data: data,
		headers: {
			"Content-Type": "application/json;charset=UTF-8"
		}
	})
}

export function biAchievementPortraitAPI(data) {
	const type = data.type_analyse
	if (type === "industry") {
		return request({
			url: BASE_URL + "biRanking/portrait",
			method: "post",
			data: data,
			headers: {
				"Content-Type": "application/json;charset=UTF-8"
			}
		})
	} else if (type === "level") {
		return request({
			url: BASE_URL + "biRanking/portraitLevel",
			method: "post",
			data: data,
			headers: {
				"Content-Type": "application/json;charset=UTF-8"
			}
		})
	} else if (type === "source") {
		return request({
			url: BASE_URL + "biRanking/portraitSource",
			method: "post",
			data: data,
			headers: {
				"Content-Type": "application/json;charset=UTF-8"
			}
		})
	}
}
